<template>
    <div>
        <comp ref="bar" :params="params" height="300px" width="100%" />
    </div>
</template>
<script>
import comp from "./../bar/index";

export default {
    name: "test",
    title: "柱子收入支出",
    components: { comp },
    theme: "black",
    data() {
        return {
            params:{},
            dataCols: {
                dimension: ["日期"],
                legend: {
                    data: ["收入",'支出'],
                },
                series: [
                    {
                        日期: "1-1",
                        收入: 10,
                        支出:'-10',
                    },
                    {
                        日期: "1-2",
                        收入: 11,
                        支出:'-10'
                    },
                    {
                        日期: "1-3",
                        收入: 12,
                        支出:'-10'
                    },
                    {
                        日期: "1-4",
                        收入: 30,
                        支出:'-10'
                    },
                    {
                        日期: "1-5",
                        收入: 90,
                        支出:'-40'
                    },
                    {
                        日期: "1-6",
                        收入: 30,
                        支出:'-20'
                    },
                    {
                        日期: "1-7",
                        收入: 90,
                        支出:'-50'
                    },
                    {
                        日期: "1-8",
                        收入: 50,
                        支出:'-10'
                    },
                    {
                        日期: "1-9",
                        收入: 90,
                        支出:'-40'
                    },
                ],
            },
            setting: {
                dimension: ["日期"],
                grid: {},
                legend: {},
                xAxis: {
                },
                series: {
                    stack:{
                        收入:'1',
                        支出:'1'
                    },
                    barWidth: 12,
                    linear: {
                        收入: ["#0B4EC3", "#138CEB"],
                    },
                    barBorderRadius: [5],
                },
                color: [],
            },
        };
    },
    mounted() {
        this.$nextTick(() => {
            let param = {
                dataCols: this.dataCols,
                setting: this.setting,
            };
            this.params={...param};
            //this.$refs.bar.initChart(param);
        });
    },
};
</script>